const MyPromise = require('./MyPromise')

let promise = new MyPromise((resolve, reject)=>{
  setTimeout(() => {
    resolve('成功......')
    // reject('失败')
  }, 2000);
  // resolve('成功')
  // reject('失败')

})

// promise.then(value => {
//   console.log(1)
//   console.log(value)
// }, (reason) => {
//   console.log(reason)
// })

// promise.then(value => {
//   console.log(2)
//   console.log(value)
// }, (reason) => {
//   console.log(reason)
// })

// promise.then(value => {
//   console.log(3)
//   console.log(value)
// }, (reason) => {
//   console.log(reason)
// })

function other (){
  return new MyPromise((resolve,reject)=>{
    resolve('other');
  })
}

// let p1 = promise.then(value=>{
//   console.log(value)
//   return p1
// })
